<!DOCTYPE html>
<html>
  <head>
    <title>100以内的和</title>
  </head>
  <body>
    <div>
      <input type="text" id="one" />
      <button onclick="computNum()">计算</button>
      <script>
        function computNum() {
          let sum = 0;
          for (let i = 0; i < 100; i++) {
            if (i % 2 == 0) {
              console.log("!!!", i);
              sum = sum + i;
            }
          }
          document.getElementById("one").value = sum;
        }
      </script>
    </div>
  </body>
</html>
